-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix incorrect fread return value check in ilasm strong-name key loading #121837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure. The incorrect condition: ``` dwBytesRead = fread(m_sStrongName.m_pbPublicKey, 1, m_sStrongName.m_cbPublicKey, fp)) <= m_sStrongName.m_cbPublicKey) ``` causes the error branch to execute even when the full key file has been read successfully (dwBytesRead == m_sStrongName.m_cbPublicKey). This results in ilasm failing to read .snk key files when building TestILAssembly on big Endian Systems. Environment: Architecture: s390x OS: Ubuntu Runtime : Mono cc: @uweigand @giritrivedi @saitama951
|
Introduced in #116203. Do we have strong name coverage in the repo at all? |
|
Tagging subscribers to this area: @JulieLeeMSFT |
|
There is only very limited strong-name coverage in the repo, and none for the ilasm key-file reading that #116203 modified. |
|
@Dotnet-s390x build |
|
Build Queued.. To cancel the current build, please comment: |
|
Build Successful |
|
@JulieLeeMSFT @huoyaoyuan The s390x CI is failing because of this, can this be merged? |
|
There are multiple ilasm failures in last CI build, and the build has expired. Can you merge and rerun them to see if they are related? /cc @jkotas |
Summary:
This PR fixes a logic error in AsmMan::EndAssembly() that incorrectly treated a successful fread() call as a failure. The incorrect condition:
causes the error branch to execute even when the full key file has been read successfully (dwBytesRead == m_sStrongName.m_cbPublicKey).
This results in ilasm failing to read .snk key files when building TestILAssembly on Big Endian Systems.
Environment:
Architecture: s390x
OS: Ubuntu
Runtime : Mono
cc: @uweigand @giritrivedi @saitama951